package edu.sctu.renpingan.day20150526.Hashmap;


import edu.sctu.renpingan.day20150518.Student;

import java.util.HashMap;


/**
 * Created by user18 on 2015/5/26.
 */
public class GetHashmap {
    Student student = new Student();
    public HashMap<Integer,Student> getHashmap(int size){
        HashMap<Integer,Student> map= new HashMap<Integer,Student>();
        for (int i = 0; i < size; i++) {
            map.put(i,student);
        }
        return map;
    }
    public HashMap<Integer,Student> setDataHashmap(HashMap<Integer,Student> map){
        for ( int i = 0; i < map.size(); i++) {
            map.get(i).name = "张三"+i;
            map.get(i).adress = "中国"+i;
            map.get(i).age= 20+i;
            System.out.println(map.get(i).name+"  "+map.get(i).age+"   "+map.get(i).adress);
        }
        return map;
    }
}
